#include <stdio.h>

int main(int argc, char const *argv[])
{
    if(argc != 3)
    {
        printf("Pls input: ./a.out <dst file name> <string to be written>\n");
        return -1;
    }
    
    FILE *fpDst = fopen(argv[1], "w");
    if( NULL == fpDst)
    {
        printf("Fail to open file\n");
        return -1;
    }

    int iRet = fputs(argv[2], fpDst);
    if( iRet < 0 )
    {
        printf("Fail to fputs\n");
        return -1;
    }

    fclose(fpDst);

    return 0;
}

/*
函数 fputs
    将一个字符串写入打开的文件流
*/